home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / zodiack.c < prev   
C/C++ Source or Header  |  2000-05-04  |  23KB  |  594 lines

  1. /***************************************************************************
  2.  
  3. Zodiack/Dogfight Memory Map (preliminary)
  4.  
  5. sriver by Zsolt Vasvari
  6.  
  7. Memory Mapped:
  8.  
  9.  
  10. I/O Ports:
  11.  
  12. 00-01        W   AY8910 #0
  13.  
  14.  
  15. TODO:
  16.  
  17. - Verify Z80 and AY8910 clock speeds
  18.  
  19. ***************************************************************************/
  20.  
  21. #include "driver.h"
  22. #include "vidhrdw/generic.h"
  23.  
  24.  
  25. extern unsigned char *zodiack_videoram2;
  26. extern unsigned char *galaxian_attributesram;
  27. extern unsigned char *galaxian_bulletsram;
  28. extern size_t galaxian_bulletsram_size;
  29.  
  30. int percuss_hardware;
  31.  
  32. void zodiack_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  33. void zodiack_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  34. void zodiack_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  35. WRITE_HANDLER( galaxian_attributes_w );
  36. WRITE_HANDLER( zodiac_flipscreen_w );
  37. WRITE_HANDLER( zodiac_control_w );
  38.  
  39. void espial_init_machine(void);
  40. WRITE_HANDLER( zodiac_master_interrupt_enable_w );
  41. int  zodiac_master_interrupt(void);
  42. WRITE_HANDLER( zodiac_master_soundlatch_w );
  43.  
  44.  
  45. static void zodiack_init_machine(void)
  46. {
  47.     percuss_hardware = 0;
  48.     espial_init_machine();
  49. }
  50.  
  51. static void percuss_init_machine(void)
  52. {
  53.     percuss_hardware = 1;
  54.     espial_init_machine();
  55. }
  56.  
  57.  
  58. static struct MemoryReadAddress readmem[] =
  59. {
  60.     { 0x0000, 0x4fff, MRA_ROM },
  61.     { 0x5800, 0x5fff, MRA_RAM },
  62.     { 0x6081, 0x6081, input_port_0_r },
  63.     { 0x6082, 0x6082, input_port_1_r },
  64.     { 0x6083, 0x6083, input_port_2_r },
  65.     { 0x6084, 0x6084, input_port_3_r },
  66.     { 0x6090, 0x6090, soundlatch_r },
  67.     { 0x7000, 0x7000, MRA_NOP },  /* ??? */
  68.     { 0x9000, 0x93ff, MRA_RAM },
  69.     { 0xa000, 0xa3ff, MRA_RAM },
  70.     { 0xb000, 0xb3ff, MRA_RAM },
  71.     { 0xc000, 0xcfff, MRA_ROM },
  72.     { -1 }  /* end of table */
  73. };
  74.  
  75.  
  76. static struct MemoryWriteAddress writemem[] =
  77. {
  78.     { 0x0000, 0x4fff, MWA_ROM },
  79.     { 0x5800, 0x5fff, MWA_RAM },
  80.     { 0x6081, 0x6081, zodiac_control_w },
  81.     { 0x6090, 0x6090, zodiac_master_soundlatch_w },
  82.     { 0x7000, 0x7000, watchdog_reset_w },
  83.     { 0x7100, 0x7100, zodiac_master_interrupt_enable_w },
  84.     { 0x7200, 0x7200, zodiac_flipscreen_w },
  85.     { 0x9000, 0x903f, galaxian_attributes_w, &galaxian_attributesram },
  86.     { 0x9040, 0x905f, MWA_RAM, &spriteram, &spriteram_size },
  87.     { 0x9060, 0x907f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  88.     { 0x9080, 0x93ff, MWA_RAM },
  89.     { 0xa000, 0xa3ff, videoram_w, &videoram, &videoram_size },
  90.     { 0xb000, 0xb3ff, MWA_RAM, &zodiack_videoram2 },
  91.     { 0xc000, 0xcfff, MWA_ROM },
  92.     { -1 }  /* end of table */
  93. };
  94.  
  95. static struct MemoryReadAddress sound_readmem[] =
  96. {
  97.     { 0x0000, 0x0fff, MRA_ROM },
  98.     { 0x2000, 0x23ff, MRA_RAM },
  99.     { 0x6000, 0x6000, soundlatch_r },
  100.     { -1 }    /* end of table */
  101. };
  102.  
  103. static struct MemoryWriteAddress sound_writemem[] =
  104. {
  105.     { 0x0000, 0x0fff, MWA_ROM },
  106.     { 0x2000, 0x23ff, MWA_RAM },
  107.     { 0x4000, 0x4000, interrupt_enable_w },
  108.     { 0x6000, 0x6000, soundlatch_w },
  109.     { -1 }    /* end of table */
  110. };
  111.  
  112. static struct IOWritePort sound_writeport[] =
  113. {
  114.     { 0x00, 0x00, AY8910_control_port_0_w },
  115.     { 0x01, 0x01, AY8910_write_port_0_w },
  116.     { -1 }    /* end of table */
  117. };
  118.  
  119.  
  120. INPUT_PORTS_START( zodiac )
  121.     PORT_START      /* DSW0 */  /* never read in this game */
  122.     PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
  123.  
  124.     PORT_START      /* DSW1 */
  125.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  126.     PORT_DIPSETTING(    0x00, "3" )
  127.     PORT_DIPSETTING(    0x01, "4" )
  128.     PORT_DIPSETTING(    0x02, "5" )
  129.     PORT_DIPSETTING(    0x03, "6" )
  130.     PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) )
  131.     PORT_DIPSETTING(    0x14, DEF_STR( 2C_1C ) )
  132.     PORT_DIPSETTING(    0x18, "2 Coins/1 Credit  3 Coins/2 Credits" )
  133.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  134.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  135.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  136.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  137.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
  138.     PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
  139.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
  140.     PORT_DIPSETTING(    0x00, "20000 50000" )
  141.     PORT_DIPSETTING(    0x20, "40000 70000" )
  142.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
  143.     PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
  144.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  145.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  146.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  147.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  148.  
  149.     PORT_START      /* IN0 */
  150.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  151.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  152.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  153.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  154.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  155.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  156.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  157.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  158.  
  159.     PORT_START      /* IN1 */
  160.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  161.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  162.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  163.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  164.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  165.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)
  166.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  167.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  168. INPUT_PORTS_END
  169.  
  170. INPUT_PORTS_START( dogfight )
  171.     PORT_START      /* DSW0 */
  172.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_B ) )
  173.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
  174.     PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) )
  175.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  176.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  177.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  178.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  179.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
  180.     PORT_DIPSETTING(    0x07, DEF_STR( Free_Play ) )
  181.     PORT_DIPNAME( 0x38, 0x00, DEF_STR( Coin_A ) )
  182.     PORT_DIPSETTING(    0x38, DEF_STR( 5C_1C ) )
  183.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
  184.     PORT_DIPSETTING(    0x28, DEF_STR( 3C_1C ) )
  185.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
  186.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  187.     PORT_DIPSETTING(    0x18, DEF_STR( 3C_4C ) )
  188.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  189.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
  190.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )  /* most likely unused */
  191.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  192.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  193.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )  /* most likely unused */
  194.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  195.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  196.  
  197.     PORT_START      /* DSW1 */
  198.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  199.     PORT_DIPSETTING(    0x00, "3" )
  200.     PORT_DIPSETTING(    0x01, "4" )
  201.     PORT_DIPSETTING(    0x02, "5" )
  202.     PORT_DIPSETTING(    0x03, "6" )
  203.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )  /* most likely unused */
  204.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  205.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  206.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )  /* most likely unused */
  207.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  208.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  209.     PORT_BITX(    0x10, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  210.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  211.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  212.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
  213.     PORT_DIPSETTING(    0x00, "20k, 50k, then every 50k" )
  214.     PORT_DIPSETTING(    0x20, "40k, 70k, then every 70k" )
  215.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
  216.     PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
  217.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  218.     PORT_DIPNAME( 0x80, 0x00, "Freeze" )
  219.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  220.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  221.  
  222.     PORT_START      /* IN0 */
  223.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  224.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  225.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  226.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  227.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  228.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  229.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  230.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  231.  
  232.     PORT_START      /* IN1 */
  233.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
  234.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  235.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  236.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  237.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  238.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)
  239.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  240.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  241. INPUT_PORTS_END
  242.  
  243. INPUT_PORTS_START( moguchan )
  244.     PORT_START      /* DSW0 */
  245.     PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  246.  
  247.     PORT_START      /* DSW1 */
  248.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  249.     PORT_DIPSETTING(    0x00, "3" )
  250.     PORT_DIPSETTING(    0x01, "4" )
  251.     PORT_DIPSETTING(    0x02, "5" )
  252.     PORT_DIPSETTING(    0x03, "6" )
  253.     PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) )
  254.     PORT_DIPSETTING(    0x14, DEF_STR( 2C_1C ) )
  255.     PORT_DIPSETTING(    0x18, "2 Coins/1 Credit  3 Coins/2 Credits" )
  256.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  257.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  258.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  259.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  260.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
  261.     PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
  262.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
  263.     PORT_DIPSETTING(    0x00, "20000 50000" )
  264.     PORT_DIPSETTING(    0x20, "40000 70000" )
  265.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
  266.     PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
  267.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  268.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  269.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  270.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  271.  
  272.     PORT_START      /* IN0 */
  273.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  274.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  275.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  276.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  277.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  278.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  279.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  280.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  281.  
  282.     PORT_START      /* IN1 */
  283.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  284.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  285.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  286.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  287.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  288.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)        /* these are read, but are they */
  289.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )                    /* ever used? */
  290.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  291. INPUT_PORTS_END
  292.  
  293. INPUT_PORTS_START( percuss )
  294.     PORT_START      /* DSW0 */
  295.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  296.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  297.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  298.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  299.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  300.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  301.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  302.     PORT_DIPSETTING(    0x00, "20000 100000" )
  303.     PORT_DIPSETTING(    0x04, "20000 200000" )
  304.     PORT_DIPSETTING(    0x08, "40000 100000" )
  305.     PORT_DIPSETTING(    0x0c, "40000 200000" )
  306.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
  307.     PORT_DIPSETTING(    0x10, DEF_STR( Upright ) )
  308.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  309.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  310.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  311.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  312.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  313.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  315.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  316.  
  317.     PORT_START      /* DSW1 */
  318.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  319.     PORT_DIPSETTING(    0x00, "4" )
  320.     PORT_DIPSETTING(    0x01, "5" )
  321.     PORT_DIPSETTING(    0x02, "6" )
  322.     PORT_DIPSETTING(    0x03, "7" )
  323.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  324.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  325.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  326.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  327.     PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
  328.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  330.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  331.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  332.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  333.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  334.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  335.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  336.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  337.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  338.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  339.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  340.  
  341.     PORT_START      /* IN0 */
  342.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  343.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  344.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  345.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  346.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  347.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  348.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  349.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL)
  350.  
  351.     PORT_START      /* IN1 */
  352.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  353.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  354.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  355.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  356.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  357.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)
  358.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  359.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  360. INPUT_PORTS_END
  361.  
  362.  
  363. static struct GfxLayout charlayout =
  364. {
  365.     8,8,    /* 8*8 chars */
  366.     256,    /* 256 characters */
  367.     1,      /* 1 bit per pixel */
  368.     { 0 } , /* single bitplane */
  369.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  370.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  371.     8*8     /* every char takes 8 consecutive bytes */
  372. };
  373.  
  374. static struct GfxLayout charlayout_2 =
  375. {
  376.     8,8,    /* 8*8 chars */
  377.     256,    /* 256 characters */
  378.     2,      /* 2 bits per pixel */
  379.     { 0, 512*8*8 },  /* The bitplanes are seperate */
  380.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  381.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  382.     8*8     /* every char takes 8 consecutive bytes */
  383. };
  384.  
  385. static struct GfxLayout spritelayout =
  386. {
  387.     16,16,  /* 16*16 sprites */
  388.     64,     /* 64 sprites */
  389.     2,      /* 2 bits per pixel */
  390.     { 0, 128*32*8 },        /* the two bitplanes are separated */
  391.     {     0,     1,     2,     3,     4,     5,     6,     7,
  392.       8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  393.     {  0*8,  1*8,  2*8,  3*8,  4*8,  5*8,  6*8,  7*8,
  394.       16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  395.     32*8    /* every sprite takes 32 consecutive bytes */
  396. };
  397.  
  398. static struct GfxLayout bulletlayout =
  399. {
  400.     /* there is no gfx ROM for this one, it is generated by the hardware */
  401.     7,1,    /* it's just 1 pixel, but we use 7*1 to position it correctly */
  402.     1,    /* just one */
  403.     1,    /* 1 bit per pixel */
  404.     { 10*8*8 },    /* point to letter "A" */
  405.     { 3, 7, 7, 7, 7, 7, 7 },    /* I "know" that this bit of the */
  406.     { 1*8 },                        /* graphics ROMs is 1 */
  407.     0    /* no use */
  408. };
  409.  
  410. static struct GfxDecodeInfo gfxdecodeinfo[] =
  411. {
  412.     { REGION_GFX1, 0x0000, &charlayout,   8*4    , 8 },
  413.     { REGION_GFX1, 0x0800, &spritelayout, 0      , 8 },
  414.     { REGION_GFX1, 0x0000, &bulletlayout, 8*4+8*2, 1 },
  415.     { REGION_GFX1, 0x1000, &charlayout_2, 0      , 8 },
  416.     { -1 } /* end of array */
  417. };
  418.  
  419.  
  420. static struct AY8910interface ay8910_interface =
  421. {
  422.     1,    /* 1 chip */
  423.     1789750,    /* 1.78975 MHz? */
  424.     { 50 },
  425.     { 0 },
  426.     { 0 },
  427.     { 0 },
  428.     { 0 }
  429. };
  430.  
  431.  
  432. #define MACHINE_DRIVER(GAMENAME)                            \
  433. static struct MachineDriver machine_driver_##GAMENAME =        \
  434. {                                                            \
  435.     /* basic machine hardware */                            \
  436.     {                                                        \
  437.         {                                                    \
  438.             CPU_Z80,                                        \
  439.             4000000,        /* 4.00 MHz??? */                \
  440.             readmem,writemem,0,0,                            \
  441.             zodiac_master_interrupt,2                        \
  442.         },                                                    \
  443.         {                                                    \
  444.             CPU_Z80,                                        \
  445.             14318000/8,    /* 1.78975 Mhz??? */                \
  446.             sound_readmem,sound_writemem,0,sound_writeport,    \
  447.             nmi_interrupt,8    /* IRQs are triggered by the main CPU */    \
  448.         }                                                    \
  449.     },                                                        \
  450.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,  /* frames per second, vblank duration */            \
  451.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */    \
  452.     GAMENAME##_init_machine,                                \
  453.                                                             \
  454.     /* video hardware */                                    \
  455.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },                \
  456.     gfxdecodeinfo,                                            \
  457.     49, 4*8+2*8+2*1,                                        \
  458.     zodiack_vh_convert_color_prom,                            \
  459.                                                             \
  460.     VIDEO_TYPE_RASTER,                                        \
  461.     0,                                                        \
  462.     generic_vh_start,                                        \
  463.     generic_vh_stop,                                        \
  464.     zodiack_vh_screenrefresh,                                \
  465.                                                             \
  466.     /* sound hardware */                                    \
  467.     0,0,0,0,                                                \
  468.     {                                                        \
  469.         {                                                    \
  470.             SOUND_AY8910,                                    \
  471.             &ay8910_interface                                \
  472.         }                                                    \
  473.     }                                                        \
  474. };
  475.  
  476. MACHINE_DRIVER(zodiack)
  477. MACHINE_DRIVER(percuss)
  478.  
  479. /***************************************************************************
  480.  
  481.   Game driver(s)
  482.  
  483. ***************************************************************************/
  484. ROM_START( zodiack )
  485.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  486.     ROM_LOAD( "ovg30c.2",     0x0000, 0x2000, 0xa2125e99 )
  487.     ROM_LOAD( "ovg30c.3",     0x2000, 0x2000, 0xaee2b77f )
  488.     ROM_LOAD( "ovg30c.6",     0x4000, 0x0800, 0x1debb278 )
  489.  
  490.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  491.     ROM_LOAD( "ovg20c.1",     0x0000, 0x1000, 0x2d3c3baf )
  492.  
  493.     ROM_REGION( 0x2800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  494.     ROM_LOAD( "ovg40c.7",     0x0000, 0x0800, 0xed9d3be7 )
  495.     ROM_LOAD( "orca40c.8",    0x0800, 0x1000, 0x88269c94 )
  496.     ROM_LOAD( "orca40c.9",    0x1800, 0x1000, 0xa3bd40c9 )
  497.  
  498.     ROM_REGION( 0x0040, REGION_PROMS )
  499.     ROM_LOAD( "ovg40c.2a",    0x0000, 0x0020, 0x703821b8 )
  500.     ROM_LOAD( "ovg40c.2b",    0x0020, 0x0020, 0x21f77ec7 )
  501. ROM_END
  502.  
  503. ROM_START( dogfight )
  504.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  505.     ROM_LOAD( "df-2",         0x0000, 0x2000, 0xad24b28b )
  506.     ROM_LOAD( "df-3",         0x2000, 0x2000, 0xcd172707 )
  507.     ROM_LOAD( "df-5",         0x4000, 0x1000, 0x874dc6bf )
  508.     ROM_LOAD( "df-4",         0xc000, 0x1000, 0xd8aa3d6d )
  509.  
  510.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  511.     ROM_LOAD( "df-1",         0x0000, 0x1000, 0xdcbb1c5b )
  512.  
  513.     ROM_REGION( 0x2800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  514.     ROM_LOAD( "df-6",         0x0000, 0x0800, 0x3059b515 )
  515.     ROM_LOAD( "df-7",         0x0800, 0x1000, 0xffe05fee )
  516.     ROM_LOAD( "df-8",         0x1800, 0x1000, 0x2cb51793 )
  517.  
  518.     ROM_REGION( 0x0040, REGION_PROMS )
  519.     ROM_LOAD( "1.bpr",        0x0000, 0x0020, 0x69a35aa5 )
  520.     ROM_LOAD( "2.bpr",        0x0020, 0x0020, 0x596ae457 )
  521. ROM_END
  522.  
  523. ROM_START( moguchan )
  524.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  525.     ROM_LOAD( "2.5r",         0x0000, 0x1000, 0x85d0cb7e )
  526.     ROM_LOAD( "4.5m",         0x1000, 0x1000, 0x359ef951 )
  527.     ROM_LOAD( "3.5np",        0x2000, 0x1000, 0xc8776f77 )
  528.  
  529.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  530.     ROM_LOAD( "1.7hj",        0x0000, 0x1000, 0x1a88d35f )
  531.  
  532.     ROM_REGION( 0x2800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  533.     ROM_LOAD( "5.4r",         0x0000, 0x0800, 0x1b7febd8 )
  534.     ROM_LOAD( "6.7p",         0x0800, 0x1000, 0xc8060ffe )
  535.     ROM_LOAD( "7.7m",         0x1800, 0x1000, 0xbfca00f4 )
  536.  
  537.     ROM_REGION( 0x0040, REGION_PROMS )
  538.     ROM_LOAD( "moguchan.2a",  0x0000, 0x0020, 0xe83daab3 )
  539.     ROM_LOAD( "moguchan.2b",  0x0020, 0x0020, 0x9abfdf40 )
  540. ROM_END
  541.  
  542. ROM_START( percuss )
  543.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  544.     ROM_LOAD( "percuss.1",    0x0000, 0x1000, 0xff0364f7 )
  545.     ROM_LOAD( "percuss.3",    0x1000, 0x1000, 0x7f646c59 )
  546.     ROM_LOAD( "percuss.2",    0x2000, 0x1000, 0x6bf72dd2 )
  547.     ROM_LOAD( "percuss.4",    0x3000, 0x1000, 0xfb1b15ba )
  548.     ROM_LOAD( "percuss.5",    0x4000, 0x1000, 0x8e5a9692 )
  549.  
  550.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  551.     ROM_LOAD( "percuss.8",    0x0000, 0x0800, 0xd63f56f3 )
  552.     ROM_LOAD( "percuss.9",    0x0800, 0x0800, 0xe08fef2f )
  553.  
  554.     ROM_REGION( 0x2800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  555.     ROM_LOAD( "percuss.10",   0x0000, 0x0800, 0x797598aa )
  556.     ROM_LOAD( "percuss.6",    0x0800, 0x1000, 0x5285a580 )
  557.     ROM_LOAD( "percuss.7",    0x1800, 0x1000, 0x8fc4175d )
  558.  
  559.     ROM_REGION( 0x0040, REGION_PROMS )
  560.     ROM_LOAD( "percus2a.prm", 0x0000, 0x0020, 0xe2ee9637 )
  561.     ROM_LOAD( "percus2b.prm", 0x0020, 0x0020, 0xe561b029 )
  562. ROM_END
  563.  
  564. ROM_START( bounty )
  565.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  566.     /* first 256 bytes are missing due to protection - they are replaced */
  567.     /* with stub code that draws the Orca logo on screen */
  568.     ROM_LOAD( "1.4f",      0x0000, 0x1000, BADCRC( 0xb3776ecb ) )
  569.     ROM_LOAD( "3.4k",      0x1000, 0x1000, 0xfa3086c3 )
  570.     ROM_LOAD( "2.4h",      0x2000, 0x1000, 0x52ab5314 )
  571.     ROM_LOAD( "4.4m",      0x3000, 0x1000, 0x5c9d3f07 )
  572.  
  573.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the audio CPU */
  574.     ROM_LOAD( "7.4n",      0x0000, 0x1000, 0x45e369b8 )
  575.     ROM_LOAD( "8.4r",      0x1000, 0x1000, 0x4f52c87d )
  576.  
  577.     ROM_REGION( 0x2800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  578.     ROM_LOAD( "9.4r",      0x0000, 0x0800, 0x4b4acde5 )
  579.     ROM_LOAD( "5.7m",      0x0800, 0x1000, 0xa5ce2a24 )
  580.     ROM_LOAD( "6.7p",      0x1800, 0x1000, 0x43183301 )
  581.  
  582.     ROM_REGION( 0x0040, REGION_PROMS )
  583.     ROM_LOAD( "mb7051.2a",   0x0000, 0x0020, 0x0de11a46 )
  584.     ROM_LOAD( "mb7051.2b",   0x0020, 0x0020, 0x465e31d4 )
  585. ROM_END
  586.  
  587.  
  588.  
  589. GAMEX(1983, zodiack,  0, zodiack, zodiac,   0, ROT270, "Orca (Esco Trading Co, Inc)", "Zodiack", GAME_IMPERFECT_COLORS )    /* bullet color needs to be verified */
  590. GAMEX(1983, dogfight, 0, zodiack, dogfight, 0, ROT270, "[Orca] Thunderbolt", "Dog Fight", GAME_IMPERFECT_COLORS )    /* bullet color needs to be verified */
  591. GAMEX(1982, moguchan, 0, zodiack, moguchan, 0, ROT270, "Orca (Eastern Commerce Inc. license) (bootleg?)",  /* this is in the ROM at $0b5c */ "Moguchan", GAME_WRONG_COLORS )
  592. GAME( 1981, percuss,  0, percuss, percuss,  0, ROT270, "Orca", "The Percussor" )
  593. GAMEX(1982, bounty,   0, zodiack, percuss,  0, ROT0,   "Orca", "The Bounty", GAME_NOT_WORKING )
  594.